import URL from '@/config/url'
import utils from '@/utils/utils'

export default {

	//申请售后
	aftersaleApply(params = {}) {
		let data = {
			//store_id: Number(params.product.refund_num),  // 店铺id(int)
			product: params.product,
			user_id: params.user_id,
			refund_type: params.refund_type,
			store_id: Number(params.store_id),
			order_code: params.order_code,
		}
		return utils.uniRequest({
			url: URL.BASE + '/shop/aftersale/apply',
			data
		})
	},
	// 售后订单列表
	getOrderlist(params = {}) {
		let data = {
			page: params.page,
			pagesize: 10,
			status: params.status,
			keyword: params.keyword
		}
		return utils.uniRequest({
			url: URL.BASE + '/shop/aftersale/record',
			data
		})
	},
	// 售后订单取消
	ordercancel(params = {}) {
		let data = {
			after_sale_id: params.after_sale_id,
			user_id: params.user_id
		}
		return utils.uniRequest({
			url: URL.BASE + '/shop/aftersale/close',
			data
		})
	},
	// 售后订单详情
	getDetails(params = {}) {
		let data = {
			after_sale_id: params.after_sale_id,
			user_id: params.user_id
		}
		return utils.uniRequest({
			url: URL.BASE + '/shop/aftersale/detail',
			data
		})
	},
	//物流公司
	logistics(params = {}){
		let data = {
			
		}
		return utils.uniRequest({
			url: URL.BASE + '/shop/Basic/express',
			data
		})
	},
	//
	subLogistics(params = {}){
		let data = {
			user_id:params.user_id,
			reship_id:params.reship_id,
			logi_no:params.logi_no,//快递单号
			logi_code:params.logi_code,
		}
		return utils.uniRequest({
			url: URL.BASE + '/shop/aftersale/sendreship',
			data
		})
	}
}
